﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Web;

namespace Silverlight.Weblog.UI.Web.Email
{
    public class EmailService : IEmailService
    {
        #region Implementation of IEmailService

        public void SendEmail(string To, string From, string subject, string Body)
        {
            MailMessage mail = new MailMessage();
            mail.From = new MailAddress(From);
            mail.To.Add(To);
            mail.Subject = subject;
            mail.Body = Body;
            mail.IsBodyHtml = true;

            SmtpClient smtp = new SmtpClient(); 
            
#if !DEBUG
            smtp.Send(mail);
#endif
        }

        #endregion
    }
}
